package com.jh.user.business;

import cn.jh.common.exception.ServiceException;
import com.jh.user.pojo.*;

import java.util.List;
import java.util.Map;

public interface ThirdLeveDistributionBusiness {


	public List<ThirdLevelDistribution>  getAllThirdLevelPrd(long brand);

	public ThirdLevelDistribution  getThirdLevelByBrandidandgrade(long brand,  int grade);


	public ThirdLevelDistribution getThirdLevelByBrandidandgradeNoStatus(long brand,
																		 int grade) ;

	public ThirdLevelDistribution  queryThirdLevelDistribution(long thirdlevel);

	public List<ThirdLevelRate> findAllThirdLevelRates(long thirdlevel);

	/**
	 * 查询产品指定通道的费率
	 * **/
	public ThirdLevelRate findAllThirdLevelRatesBylevelidAndChannelId(long thirdlevel,long channelId);

	/**
	 * 查询指定贴牌的通道费率
	 *
	 * @param brandId 贴牌id
	 * @return 返回通道费率
	 */
	List<ChannelVO> findThirdLevelChannelRate(Long brandId);

	public ThirdLevelRate addThirdLevelRates(ThirdLevelRate tlr);


	public ThirdLevelDistribution  mergeThirdDistribution(ThirdLevelDistribution distribution);

	public void delThirdLevelByid(long id);

	public List<ThirdLevelRebateRatio>   getAllThirdRatio(long brand);


	public ThirdLevelRebateRatio getThirdRatioByBrandidandprelevel(long brand,  String prelevel);

	public ThirdLevelRebateRatio  mergeThirdLevelRebateRatio(ThirdLevelRebateRatio rebateRatio);

	//根据brandid查询最高等级
	public int findThirdLevelDistributionByBrandid(long brandId);

	//根据grade删除
	public void deleteThirdLevelDistributionByGrade(int grade,long brandId);

	public List<ThirdLevelRebateRatioNew> getAllThirdRatio(long brandid, Integer thirdLevelId);

	public ThirdLevelRebateRatioNew getByBrandIdAndPreLevelAndThirdLevelId(Long brandid, Integer thirdLevelId,String preLevel);

	public ThirdLevelRebateRatioNew mergeThirdLevelRebateRatio(ThirdLevelRebateRatioNew ratioModel);

	public List<ThirdLevelRebateRatioNew> getAllThirdRatioByBrandId(Long brandid);

	public ThirdLevelRebateRatioNew getThirdRatioById(Long id);

    List<Map<String, Object>> queryThirdLevelListByBrandId(long brandId) throws ServiceException;
}
